@REM ----------------------------------------------------------------------------
@REM
@REM build package
@REM
@REM ----------------------------------------------------------------------------
@echo off
set env=%1%

if "%env%" == "" goto EnvNotFound

echo =================================>&2
echo start package, environment: %env%>&2
echo =================================>&2


if "%JAVA_HOME%" == "" goto JDKNotFound

if "%MAVEN_HOME%" == "" goto MAVENNotFound

mvn clean package -DskipTests=true -P %env%

:JDKNotFound
echo =================================>&2
echo Error: JAVA_HOME not found in your environment. >&2
echo =================================>&2

:MAVENNotFound
echo =================================>&2
echo Error: MAVEN_HOME not found in your environment. >&2
echo =================================>&2

:EnvNotFound
echo =================================>&2
echo Error: env param not found. >&2
echo Please run script like: ./build.cmd dev / ./build.cmd prod >&2
echo =================================>&2

echo =================================>&2
echo end package. >&2
echo =================================>&2